<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/10/30/030
 * Time: 10:06
 */
namespace App\Http\Controllers\Index;

use App\Http\Common\Lib\ImgCompress;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;

class IndexController extends Controller
{
    public function index(){
    	/*$path = base_path("public");
    	$path2 = storage_path("app/public/images");
    	$src = storage_path("app/public/images/avatar")."/N4w0xfBA1HBqfBALyM98leVwgk7F6cuz6QEkoV78.jpeg";
    	$img = new ImgCompress($src,1);
    	$saveName = $path2."/thumb/test.jpeg";
    	$res = $img->compressImg($saveName);
    	dd([$path,$path2,$src,$res]);*/
        phpinfo();
        die();
        return view('index.index');
    }
    public function welcome(){
        return view('index.welcome');
    }

    public function compute(){
        return view('index.compute');
    }
    public function tiaojian(){
        return view('index.tiaojian');
    }
    public function count(Request $request){
        if($request->isMethod('post')){
            $data = [
                ['id'=>1,'title'=>'title1','content'=>'this is my content'],
                ['id'=>2,'title'=>'title2','content'=>'this is my content2'],
                ['id'=>3,'title'=>'title3','content'=>'this is my content4'],
                ['id'=>4,'title'=>'title4','content'=>'this is my content5'],
            ];
            return response()->json(['status'=>200,'msg'=>'ok','data'=>$data]);

        }else{
            return view('index.count1');
        }

    }
    public function input(){
        return view('index.input');
    }
    public function green(){
        return view('index.green');
    }
}